package com.iqiyi.controller;

import com.iqiyi.common.R;
import com.iqiyi.domain.Category;
import com.iqiyi.service.CategoryService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @auther Z_zjl
 * @date 2022/12/17 20:01
 * @Description
 */
@RestController
@RequestMapping("category")
@CrossOrigin(value = "http://localhost:8080")
public class CategoryController {
    @Resource
    private CategoryService categoryService;

    /**
     * 查询全部电影类型
     * 在添加电影时需要访问这个接口
     * @return
     */
    @GetMapping("findAll")
    public List<Category> findAll(){
        return categoryService.list();
    }
}
